package com.second.app.thread.reentrant.trylock;

/**
 * @author gyz
 * @date 2021/2/2 17:04
 */
public class Run {

    public static void main(String[] args) {
        try {
            MyService myService = new MyService();
            new Thread(new Runnable() {
                @Override
                public void run() {
                    myService.testMethod();
                }
            }, "线程A").start();

            new Thread(new Runnable() {
                @Override
                public void run() {
                    myService.testMethod();
                }
            }, "线程B").start();
            Thread.sleep(5000);
            myService.wakeup();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }


}
